package com.ruoyi.web.controller.order;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.hxzy.order.entity.TlWaybillLog;
import com.hxzy.order.entity.TtWaybill;
import com.hxzy.order.service.TlWaybillLogService;
import com.hxzy.order.service.TtWaybillService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import oshi.driver.mac.net.NetStat;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author mingqian.Wu
 * @since 2023-06-27
 */
@RestController
@RequestMapping("/tlWaybillLog")
@DataSource(DataSourceType.ORDER)
public class TlWaybillLogController {


    @Autowired
    private TlWaybillLogService tlWaybillLogService;

    @PutMapping("/updateWaybill")
    public AjaxResult updateWaybill(@RequestBody TlWaybillLog tlWaybillLog) {
        UpdateWrapper<TlWaybillLog> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("waybill_id", tlWaybillLog.getWaybillId());
        boolean update = tlWaybillLogService.update(tlWaybillLog,updateWrapper);
        if (update) {
            return AjaxResult.success("修改成功");
        }
        return AjaxResult.error("修改失败");
    }

}

